registerC2S

abstract fun <T : CustomPayload> registerC2S(id: CustomPayload.Id<T>, codec: PacketCodec<in RegistryByteBuf, T>, handler: C2SPayloadHandler<T>)

registers a server-bound (C2S) payload type and receipt handler. This must be done on both logical sides (client and server). A common entrypoint is typically the best place for this.

Author

fzzyhmstrs

Since

0.4.1

Parameters

T

the payload type to register

id

CustomPayload.Id the id of the custom payload

codec

PacketCodec the packet codec for serializing the custom payload

handler

S2CPayloadHandler a handler for dealing with receiving the payload. This handler will be on the server handling a payload sent from the client.